<template>
  <section>
    <div>
      <el-form inline>
        <el-form-item label="起始时间">
          <el-date-picker value-format="yyyy-MM-dd" v-model="searchCondition.startTime" style=" width: 150px;"></el-date-picker>
        </el-form-item>
        <el-form-item label="结束时间">
          <el-date-picker value-format="yyyy-MM-dd" v-model="searchCondition.endTime" style=" width: 150px;"></el-date-picker>
        </el-form-item>
        <el-form-item label="操作人员">
          <el-input v-model="searchCondition.createName" style=" width: 100px;"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button size="small" type="primary" @click="getLogPageData"> 查询</el-button>
        </el-form-item>
      </el-form>
    </div>
    <page-table :page-data="logList" :loading="loading" :do-get-page-data="getLogPageData">
      <el-table-column
        prop="log_type"
        label="操作明细"
        align="left"
      >
      </el-table-column>
      <el-table-column
        prop="name"
        label="姓名"
        align="left"
        width="150"
      >
      </el-table-column>

      <el-table-column
        prop="create_time"
        label="操作时间"
        align="left"
        width="180"
      ></el-table-column>
    </page-table>
    <div class="footer">
      <el-button
        size="mini"
        type="info"
        @click="close"
      >关闭
      </el-button>
    </div>
  </section>
</template>

<script>;

export default {
  name: "sortArticle",
  props: {
    articleId: Number
  },
  data() {
    return {
      logList: {},
      loading: false,
      curArticleId: 0,
      searchCondition: {
        logType: "",//日志类型
        endTime: "",//结束时间
        createName: "",//操作人
        articleId: this.articleId,//文章id
        startTime: "",//开始时间
        pageNumber: 1,
        pageSize: 10
      }
    }
  },
  mounted() {
    this.getLogPageData()
  },
  methods: {

    close() {
      this.$emit("close")
    },
    //日志列表
    getLogPageData(search) {
      this.loading = true;
      let data = Object.assign(this.searchCondition, search)
      this.API.systemLogListUsingPOST({systemLogSearch: data}).then(ret => {
        this.loading = false;
        this.logList = ret.data
      })
    }
  }
}
</script>

<style scoped>
  .footer {
    text-align: right;
    box-sizing: border-box;
  }
</style>
